fix: Use absolute path for binaries #99
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
The home directory varies across CI docker images. In CircleCI-provided convenience images, the user is
circleci
and therefore the home directory is/home/circleci
. However, on many docker images, the user might beroot
and use/root
as a home directory.The problem is that the orb currently uses
~
in all its paths, even for commands that may run on different images. As a result,download_be_executables
andsave_be_cache
write binaries to and cache them from~/project/bin
. Later, commands that try to use these binaries, likewith_job_span
, also look in~/project/bin
. But if the home directory differs between the image that cached the binaries and the one that restores the cache and tries to use them, the latter will fail to locate the binaries. For example, if the image that tries to use the binaries uses theroot
user, I observe the following error:Short description of the changes
This PR makes all of the paths in the orb absolute, rooted in
/home/circleci
. The rationale for that directory is that for CircleCI-provided convenience images, the binaries will be in the same spot they always were. This is also a directory that should be writable for both common uses: CircleCI images will be able to write to their own home directory, while images usingroot
will be able to write anywhere.